import { request } from 'ice';

// 项目列表分页查询
export const getProjectListByPage = async (params) => {
  return await request.post('/api/iot/project/queryProjectByPage', params);
};

// 单个项目详情
export const getProjectById = async (params) => {
  return await request.post(`/api/iot/project/queryProjectByOne?projectId=${params.projectId}`);
};

// 新增项目
export const addProject = async (params) => {
  return await request.post('/api/iot/project/addProject', params);
};

// 编辑项目
export const editProject = async (params) => {
  return await request.post('/api/iot/project/updateProject', params);
};

// 删除项目
export const deleteProjectById = async (params) => {
  return await request.post(`/api/iot/project/deleteByProjectId?projectId=${params.projectId}`);
};

// 项目名称校验
export const repeatProjectName = async (params) => {
  return await request.post(`/api/iot/project/repeatProjectName?projectName=${params.projectName}`);
};
